<template>
	<div class="layout">
        <Row type="flex">
            <Col span="24" class="layout-menu-left">
                <Menu active-name="" theme="dark" width="auto" :open-names="[]" mode="vertical" @on-select="route">
                    <div class="layout-logo-left" style="color: #fff">功能菜单</div>
                    <template v-for="item in items">
                    	<template v-if="item.subs && item.subs.length>0">
                    		<Submenu :name="item.id">
                    			<template slot="title">
		                    		<Icon :type="item.icon"></Icon>
                                    {{item.title}}
		                    	</template>
		                    	<Menu-item v-for="sub in item.subs" :name="sub.url" :key="sub.id">{{sub.title}}</Menu-item>
                    		</Submenu>
                    	</template>
                    	<template v-else>
                    		<Menu-item :name="item.url">{{item.title}}</Menu-item>
                    	</template>
                    </template>
                </Menu>
            </Col>
        </Row>
    </div>
</template>

<script type="text/javascript">
	export default{
		data: () =>({
			items:[]
		}),
    methods:{
    	route:function(name){
    		this.$router.push(name);
    	}
	},
    created:function(){
      //this.items = this.$root.menus;
      //this.items = this.storge.menus
      this.items =JSON.parse(localStorage.menus);
        }
	}
</script>

<style scoped>
	 .layout{
        background: #495060;
        position: relative;
        float: left;
        width:12%;
        height: 90%;
        float:left;
        padding-top: 37px;
    }
   .ivu-menu-item{
    /* background: ;*/
   }
    .layout-breadcrumb{
        padding: 10px 15px 0;
    }
    .layout-content{
        min-height: 200px;
        margin: 15px;
        overflow: hidden;
        background: #fff;
        border-radius: 4px;
    }
    .layout-content-main{
        padding: 10px;
    }
    .layout-copy{
        text-align: center;
        padding: 10px 0 20px;
        color: #9ea7b4;
    }
    .layout-menu-left{
        background: #464c5b;
    }
    .layout-header{
        height: 60px;
        background: #fff;
        box-shadow: 0 1px 1px rgba(0,0,0,.1);
    }
    .layout-logo-left{
        width: 90%;
        height: 30px;
        background: #5b6270;
        border-radius: 3px;
        margin: 15px auto;
        font-size: 21px;
    }
</style>
